<?php
namespace app\erp_meixingtiyu\model;

use think\Model;
use think\model\concern\SoftDelete;

class Referee extends Model
{
    use SoftDelete;
    protected $deleteTime = 'delete_time';
    protected $table = 'athlon_arena_referee';
    protected $pk = 'referee_id';

    public static function getList()
    {
      return self::order('sort', 'asc')
      ->paginate(15);
    }

    public static function createReferee($data)
    {
      return self::create($data);
    }

    public static function editReferee($data)
    {
      return self::update($data);
    }

    public static function destoryReferee($refereeId)
    {
      return self::destroy($refereeId);
    }

    public static function selectFreeReferees()
    {
      return self::where('arena_id', 0)->select();
    }

    public function selectRefereesByIds($ids)
    {
      return $this->where('referee_id', 'in', $ids)->select();
    }

}
